package com.huya.controller.user;

import com.huya.common.result.Result;
import com.huya.pojo.entity.TestQuestion;
import com.huya.service.TestQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/question")
public class TestQuestionController {
    @Autowired
    private TestQuestionService testQuestionService;

    /**
     * 获取测试题目列表
     * @param testId
     * @return
     */
    @GetMapping("/test/{testId}")
    public Result<List<TestQuestion>> getQuestionByTestId(@PathVariable Long testId) {
        List<TestQuestion> questionList = testQuestionService.getQuestionByTestId(testId);
        return Result.success(questionList);
    }
}
